import api from '../utils/axios'
import qs from 'qs'

import dataUtil from '../utils/dataUtil'

export default {

    /*获取人才列表*/
    getYjryList: function (option) {
        option = dataUtil.formatApiOption(option)
        //option.order = [['ying_xiang_li',1],['fa_biao_shu',1]]
        option.order = [
            // ['gbk:xing_ming',0],
            ["ying_xiang_li", 1],
            ["fa_biao_shu", 1],
        ]
        return api.post('api/v1/datasets/1013', option).then((resp) => {
            return Promise.resolve(dataUtil.formatTableData(resp.data,option.pageNumber ,option.pageSize))
        })
    },
    /*获取研究人员所在的学校列表<逆序>*/
    getCollegeList: function (option) {
        option = dataUtil.formatApiOption(option);
        return api.post('api/v1/datasets/1013', option).then((resp) => {
            return Promise.resolve(dataUtil.formatTableData(resp.data,option.pageNumber ,option.pageSize))
        })
    },

    getResearchInterestsList: function (option) {
        return api.post('api/v1/advance/keyword', option).then((resp) => {
            return Promise.resolve(resp.data)
        })
    },


    /*获取人才列表*/
    getHotYjryList: function (option) {
        option.order = [['suo_yin_shu',1]]
        option = dataUtil.formatApiOption(option)
        return api.post('api/v1/datasets/1013', option).then((resp) => {
            return Promise.resolve(dataUtil.formatTableData(resp.data))
        })
    },


    /*获取人才列表*/
    getNewYjryList: function (option) {
        option.order = [['id',1]]
        option = dataUtil.formatApiOption(option)
        return api.post('api/v1/datasets/1013', option).then((resp) => {
            return Promise.resolve(dataUtil.formatTableData(resp.data))
        })
    },

    /*获取指定学校ID信息*/
    getYjryInfoById(id) {
        let option = {
            id: id
        }
        option = dataUtil.formatApiOption(option)
        return api.post('api/v1/datasets/1013', option).then((resp) => {
            return Promise.resolve(dataUtil.formatTableData(resp.data).data[0])
        })
    },


}
